package com.zhihui.client.alarm.controller;

import com.zhihui.client.alarm.common.Lay;
import com.zhihui.client.alarm.common.Msg;
import com.zhihui.client.alarm.entity.Alarmvideo;
import com.zhihui.client.alarm.service.AlarmvideoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author zhihuian
 * @email 18037017565@163.com
 * @date 2018/10/29
 */
@Controller
@RequestMapping("/alarmvideo")
public class AlarmvideoController {
    @Resource
    private AlarmvideoService alarmvideoService;

    @RequestMapping
    public String alarmvideo(){
        return "alarmvideo/alarmvideo";
    }
    @RequestMapping("/add")
    public String add(){
        return "alarmvideo/addAlarmvideo";
    }

    @RequestMapping("/update")
    public String update(){
        return "alarmvideo/updateAlarmvideo";
    }

    @RequestMapping("/getAlarmvideos")
    @ResponseBody
    public Lay getAlarmvideos(Alarmvideo alarmvideo,Integer page,Integer limit){
        return alarmvideoService.getAlarmvideos(alarmvideo,page,limit);
    }
    @RequestMapping("/addAlarmvideo")
    @ResponseBody
    public Msg addAlarmvideo(Alarmvideo alarmvideo){
        return alarmvideoService.addAlarmvideo(alarmvideo);
    }

    @RequestMapping("/updateAlarmvideo")
    @ResponseBody
    public Msg updateAlarmvideo(Alarmvideo alarmvideo){
        return alarmvideoService.updateAlarmvideo(alarmvideo);
    }

    @RequestMapping("/delAlarmvideo")
    @ResponseBody
    public Msg delAlarmvideo(Alarmvideo alarmvideo){
        return alarmvideoService.delAlarmvideo(alarmvideo);
    }
}
